package com.dianping.abel.response.impl;

import com.dianping.abel.enums.ResponseEnum;
import lombok.Data;

/**
 * 包含数据的返回
 *
 * @author xiachao
 * @date 2018/12/20
 */
@Data
public class DataResponse<T> extends DefaultResponse {
    private static final long serialVersionUID = 1L;
    private T data;

    public DataResponse(boolean success, T data) {
        super(success);
        this.data = data;
    }

    public DataResponse(boolean success, String msg, T data) {
        super(success, msg);
        this.data = data;
    }

    public DataResponse(int code, String msg) {
        super(code, msg);
    }

    public DataResponse(int code, String msg, T data) {
        this(code, msg);
        this.data = data;
    }

    public DataResponse(ResponseEnum responseEnum) {
        super(responseEnum);
    }

    public DataResponse(ResponseEnum responseEnum, T data) {
        super(responseEnum);
        this.data = data;
    }

}
